package com.project.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.bean.ActivityBean;
import com.project.mapper.IActivityMapper;
import com.project.service.IActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.lang.reflect.AnnotatedArrayType;

/**
 * @author liuyulai
 * Created with IntelliJ IDEA.
 * Date: 21.7.11
 * Time: 16:06
 * Description: 活动业务层实现类
 */
@Service
@Transactional
public class ActivityServiceImpl implements IActivityService {
    @Autowired
    private IActivityMapper iActivityMapper;

    @Override
    public PageInfo<ActivityBean> showActivityBySchoolId(int pageNo, int schoolId) {
        PageHelper.startPage(pageNo, 3);
        PageInfo<ActivityBean> info = PageInfo.of(iActivityMapper.showActivityBySchoolId(pageNo, schoolId));
        return info;
    }

    @Override
    public void addNewActivity(ActivityBean activityBean) {
        iActivityMapper.addNewActivity(activityBean);
    }
}
